package top.arryweb.application.controller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.arryweb.application.common.constant.Result;
import top.arryweb.application.common.constant.StatusCode;
import top.arryweb.application.domain.dto.CreateTradeBlotterDTO;
import top.arryweb.application.service.IBookKeepTradeBlotterService;

/**
 * <p>
 * 交易流水表 前端控制器
 * </p>
 *
 * @author astupidcoder
 * @since 2021-05-27
 */
@Api(tags = "交易流水")
@RestController
@RequestMapping("/book-keep-trade-blotter")
public class BookKeepTradeBlotterController {

  @Autowired
  private IBookKeepTradeBlotterService tradeBlotterService;

  @ApiOperation(value = "获取交易流水ID")
  @PostMapping(value = "/getTradeBlotterId")
  public Result<Long> getTradeBlotterId(CreateTradeBlotterDTO createTradeBlotterDTO) {
    Long tradeBlotterId = tradeBlotterService.getTradeBlotterId(createTradeBlotterDTO);
    return new Result(true, StatusCode.CODE_SUCCESS, "成功获取交易流水ID", tradeBlotterId);
  }
}
